//package com.company.dcm.server;
//
//import com.company.dcm.server.tcpsocket.TCPSocketConnectThread;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.boot.ApplicationArguments;
//import org.springframework.boot.ApplicationRunner;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//import java.net.ServerSocket;
//import java.net.Socket;
//
//@Slf4j
//@Component
//public class MessageReadServer implements ApplicationRunner {
//    public static ServerSocket socket;
//    @Override
//    public void run(ApplicationArguments args) throws Exception {
//        //tcp监听
//        try {
//            socket = new ServerSocket(9989);
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//
//        while (true){
//            Socket clientSocket = socket.accept();
//            clientSocket.setSoTimeout(7000);
//            System.out.println("客户端已连接，地址和端口为：" + clientSocket.getRemoteSocketAddress());
//
//            Thread thread = new Thread(new TCPSocketConnectThread(clientSocket));
//            thread.start();
//        }
//    }
//}
